package com.maven.blog.service;

import com.maven.blog.mapper.BlogMapper;
import com.maven.blog.model.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;

    public List<Blog> getList() {
        return blogMapper.selectAll();
    }

    public Blog getListById(Integer blogId) {
        return blogMapper.selectById(blogId);
    }


    public Integer updateBlog(Blog blog) {
        return blogMapper.updateBlog(blog);
    }

    public Integer insert(Blog blog) {
        return blogMapper.insert(blog);
    }
}
